import React from 'react'
import { classnames } from '../utils'
import PropTypes from 'prop-types'
const ConfirmModal = ({ show, content, onClose, onOk }) => {
  const showConfirm = classnames({
    'modal': true,
    'show-modal': show
  })
  return (
    <div className={showConfirm}>
      <div className="modal-dialog">
        <div className="modal-content">
          <div className="modal-header">
            <h5 className="modal-title">提示</h5>
          </div>
          <div className="modal-body">
            <p>{content}</p>
          </div>
          <div className="modal-footer">
            <button type="button" className="btn btn-secondary" onClick={onClose} >取消</button>
            <button type="button" className="btn btn-primary" onClick={onOk}>确定</button>
          </div>
        </div>
      </div>
    </div>
  )
}
ConfirmModal.propTypes = {
  show: PropTypes.bool,
  content: PropTypes.string,
  onClose: PropTypes.func,
  onOk: PropTypes.func
}
ConfirmModal.defaultProps = {
  content: '是否要删除数据？'
}
export default ConfirmModal